home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_10.lha
/
7_10
/
p_cons.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
2KB
|
54 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <process.h>
include <stackdir.h>
include <debug.h> /* DELETE */
tatic char _tmpmainprocess;
tatic process *const tmpmainprocess = (process*)&_tmpmainprocess;
rocess::process(char *nname)
// set the local variables
t_name = nname ? nname : "no-name";
if (debug) /*DELETE*/ cerr << "process" << this << "::process(" << (nname ? nname : "NULL") << ")\n";
if (debug) /*DELETE*/ cerr << "\tprocess: thisprocess == " << t_thisprocess << "\n";
if (debug) /*DELETE*/ cerr << "\tprocess: t_mainprocess == " << t_mainprocess << "\n";
t_stack = 0;
t_stacksize = 0;
t_result = 1;
t_priority = 0;
t_next = 0;
t_desiredtime = 0;
t_curstate = TASK_IDLE;
// create a process for main()
if (!t_mainprocess)
{
if (debug) /*DELETE*/ cerr << "\tcreate main process\n";
t_mainprocess = tmpmainprocess;
t_thisprocess = t_mainprocess = new process("main");
if (debug) /*DELETE*/ cerr << "\tmainprocess <- " << t_mainprocess << "\n";
}
if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::process()\n";
// DELETE
stream &process::print(ostream &out) // DELETE
// DELETE
if (this) // DELETE
{ // DELETE
out << "["; // DELETE
if (debug>1) out << form("%#x", this) << ","; // DELETE
if (this == tmpmainprocess) // DELETE
out << "tmpmainprocess]"; // DELETE
else // DELETE
out << this->t_name << "]"; // DELETE
} // DELETE
else // DELETE
out << "[NULL]"; // DELETE
return out; // DELETE
// DELETE